<?php
require_once '../Model/DBconnect.php';
if(isset($_GET['playerno'])){
	$player_no = $_GET['playerno'];
	$dbconnect = DBconnect::getInstance();
	$teamName = $dbconnect->getPlayerTeamName($player_no);
	$query = $dbconnect->selectPlayerNameValuePosition($player_no);
	$position_name = mysql_result($query, 0, "pos_name");
	$player_name = mysql_result($query, 0, "player_name");
	if(strpos($player_name, " ")){
		$player_name = trim(strstr($player_name, " "));
	}
	$player_value = mysql_result($query, 0, "value");
		if($position_name != "Goalkeeper"){
			$imageName = $dbconnect->getPlayerTeamName($player_no).".png";
			$clearFunctionName = "clear".$position_name."Shirt(".$_GET['id'].",".$player_no.", ".$player_value.")";
			$hiddenName = strtolower($position_name.$_GET['id']);
		}
		else {
			$imageName = "GK".$dbconnect->getPlayerTeamName($player_no).".png";
			$clearFunctionName = "clear".$position_name."Shirt(".$player_value.")";
			$hiddenName = strtolower($position_name);
		}
		echo "<div class='ismShirtContainer' ><img src='../images/teamkits/$imageName' width='48' height='63' 
			alt='$teamName' title='$teamName' class='ismJsShirt ismShirt ismShirtPitch ismShirtZero' /></div>
			<div class='ismElementControls'>
				<a class='ismRemove' onclick='$clearFunctionName'>
					<img src='../images/background/out.png' style='cursor:pointer;' alt='Remove player' title='Remove player'/>
				</a>
				<dl class='ismElementDetail' style='display: block;'>
					<dt>
						<span class='ismElementText ismPitchWebName'>$player_name</span>
					</dt>
					<dd>
						<span class='ismElementText ismPitchStat' >$<a id='increasePlayerPrice'>".$player_value."</a></span>
					</dd>
				</dl>
				<input type='hidden' name='$hiddenName' value='$player_no' />
			</div>";
}
?>
